package com.example.repository;

import com.example.entity.Comment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;


public interface CommentRepository extends JpaRepository<Comment,Integer> {
    //通过aId查询数据，根据id降序排序
    @Query("select c from t_comment c where c.aId = ?1 order by c.id desc")
    public List<Comment> selectByAId(Integer aId);
}
